package com.jd.demo.jdk8.util;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.Random;

/**
 * Redis缓存操作工具类
 *
 * @author dongrui1@jd.com
 * @version 1.0
 */
public class RedisUtil {
    /**
     * 日志
     */
    private static final Logger logger = LogManager.getLogger(RedisUtil.class);
    
    
    public static String get(String key) {
        return new Random().nextInt(10) > 3 ? "201801180001" : null;
    }
    
    public static void set(String key, String value) {
        logger.debug("Redis已存储：key={},value={}", key, value);
    }
}
